<?php
/**
 * Created by PhpStorm.
 * User: lichangpei
 * Date: 2019/11/6
 * Time: 1:53 PM
 */
namespace app\api\model;
use think\Request;
use think\Db;
class Notice extends BaseModel
{
    protected $table = 'notice';

    /**
     * 获取首页公告
     *
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function getNotice()
    {
        $list = $this->where('is_deleted',0)->select();
        if($list){
            $status = ['code'=>1,'msg'=>'查询成功','data'=>$list];
        }else{
            $status = ['code'=>0,'msg'=>'暂无数据'];
        }
        return $status;
    }
}